From 5b6313f16f508882a0ea67716b7dbaa1c6967f04 Mon Sep 17 00:00:00 2001 From: dujinkim Date: Mon, 30 Jun 2025 08:28:13 +0000 Subject: (대표님) 20250630 16시 - 유저 도메인별 라우터 분리와 보안성검토 대응 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../(engineering)/evaluation-target-list/page.tsx | 115 +++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 app/[lng]/engineering/(engineering)/evaluation-target-list/page.tsx (limited to 'app/[lng]/engineering/(engineering)/evaluation-target-list/page.tsx') diff --git a/app/[lng]/engineering/(engineering)/evaluation-target-list/page.tsx b/app/[lng]/engineering/(engineering)/evaluation-target-list/page.tsx new file mode 100644 index 00000000..088ae75b --- /dev/null +++ b/app/[lng]/engineering/(engineering)/evaluation-target-list/page.tsx @@ -0,0 +1,115 @@ +import * as React from "react" +import { Metadata } from "next" +import { type SearchParams } from "@/types/table" +import { getValidFilters } from "@/lib/data-table" +import { Shell } from "@/components/shell" +import { DataTableSkeleton } from "@/components/data-table/data-table-skeleton" +import { HelpCircle } from "lucide-react" +import { + Popover, + PopoverContent, + PopoverTrigger, +} from "@/components/ui/popover" +import { Button } from "@/components/ui/button" +import { Badge } from "@/components/ui/badge" + +import { getDefaultEvaluationYear, searchParamsEvaluationTargetsCache } from "@/lib/evaluation-target-list/validation" +import { getEvaluationTargets } from "@/lib/evaluation-target-list/service" +import { EvaluationTargetsTable } from "@/lib/evaluation-target-list/table/evaluation-target-table" + +export const metadata: Metadata = { + title: "협력업체 평가 대상 확정", + description: "협력업체 평가 대상을 확정하고 담당자를 지정합니다.", +} + +interface EvaluationTargetsPageProps { + searchParams: Promise +} + + + +export default async function EvaluationTargetsPage(props: EvaluationTargetsPageProps) { + const searchParams = await props.searchParams + const search = searchParamsEvaluationTargetsCache.parse(searchParams) + const validFilters = getValidFilters(search.filters) + + // 기본 필터 처리 (통일된 이름 사용) + let basicFilters = [] + if (search.basicFilters && search.basicFilters.length > 0) { + basicFilters = search.basicFilters + console.log("Using search.basicFilters:", basicFilters); + } else { + console.log("No basic filters found"); + } + + // 모든 필터를 합쳐서 처리 + const allFilters = [...validFilters, ...basicFilters] + + // 조인 연산자도 통일된 이름 사용 + const joinOperator = search.basicJoinOperator || search.joinOperator || 'and'; + + // 현재 평가년도 (필터에서 가져오거나 기본값 사용) + const currentEvaluationYear = search.evaluationYear || getDefaultEvaluationYear() + + // Promise.all로 감싸서 전달 + const promises = Promise.all([ + getEvaluationTargets({ + ...search, + filters: allFilters, + joinOperator, + }) + ]) + + return ( + + {/* 간소화된 헤더 */} +
+
+
+

+ 협력업체 평가 대상 확정 +

+ + {currentEvaluationYear}년도 + + +
+
+
+ + {/* 메인 테이블 (통계는 테이블 내부로 이동) */} + + } + > + {currentEvaluationYear && + +} + +
+ ) +} \ No newline at end of file -- cgit v1.2.3